<template>
  <el-card class="card" shadow="always" :body-style="{ padding: '5px 20px' }">
    <div v-if="title" class="header">
      <el-row type="flex" justify="space-between">
        <el-col>{{ title }}</el-col>
        <slot name="icon" />
      </el-row>
    </div>
    <div class="echars">
      <slot />
    </div>
    <div v-if="$slots.foot" class="footer">
      <slot name="foot" />
    </div>
  </el-card>
</template>

<script>
export default {
  props: {
    title: {
      type: String,
      default: ''
    }
  }
}
</script>

<style scoped>
.card {
  flex: 1;
  margin: 10px;
  padding: 5px 10px;
}
.header {
  position: relative;
  height: 20px;
  font-size: 14px;
}
.footer {
  font-size: 14px;
  line-height: 22px;
  border-top: 1px solid #e8e8e8;
}
.echars {
  /* width: 349px; */
  height: 180px;
  /* overflow: hidden; */
  margin: 0 auto;
}
.el-row {
  position: absolute;
  width: 100%;
  align-items: center;
  top: 0;
  color: #97a8be;
  height: 30px;
}
</style>
